package net.lzzy.practices.entities;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.ArrayList;
import java.util.List;

/**
 * 表示一个选择题中的选项。
 * 该类继承自 BaseEntity，并使用 JPA 注解进行数据库映射。
 */
@Entity
@Table(name = "options")
@Getter
@Setter
public class Option extends BaseEntity{
    private String content;

    private String label;

    private boolean isAnswer;

    @ManyToOne
    private Question question;

    @ManyToMany(mappedBy = "options")
    private List<Result> results = new ArrayList<>();
}
